<?php

class Tools extends Core {
    
    function __construct() {
        
        parent::__construct();
        
        if (!$this->usr->check_rights('admin')) {
            
            show_error('Нет доступа!!!');
        }
        
        $this->load->model('modmanager');
        $this->load->language('admin');
        $this->load->helper('adminhelp');
        $this->load->helper('language');
    }
    
    
    function index() {
        
        $data['tools'] = array();
        $modules = $this->modmanager->get_modules();
        $this->set_bread_crumbs(lang('menu_tools'), 'tools');
        
        foreach ($modules as $row) {
            
            if (count($row->tools) > 0) {
            
                $data['tools'][] = array(
                    'method' => key($row->tools),
                    'title' => current($row->tools),
                    'modul' => $row->code
                );
            }
        }
        
        parent::render($data, 'tools/index');
    }
}